package hu.rsc.feeds.client.dnd;

import com.allen_sauer.gwt.dnd.client.DragContext;
import com.allen_sauer.gwt.dnd.client.drop.SimpleDropController;

public class FeedDropController extends SimpleDropController {
    private DropTarget dropTarget;

    public FeedDropController(DropTarget dropTarget) {
	super(dropTarget);
	this.dropTarget = dropTarget;
    }

    @Override
    public void onDrop(DragContext context) {
	/*RssWidget content = null;
	try {
	    content = (RssWidget) context.selectedWidgets.get(0);
	} catch (Exception e) {

	}
	if (this.dropTarget.getWidgetCount() != 0) {
	    Window.alert("nem kéne");
	}
	this.dropTarget.addContent(content);*/
    }

    @Override
    public void onEnter(DragContext context) {
	this.dropTarget.addStyleName("onentered");
    }

    @Override
    public void onLeave(DragContext context) {
	this.dropTarget.removeStyleName("onentered");
    }
}
